word problems on exchanging digits